<button class="layui-btn layui-btn-sm" onclick="slave_${object.code}_update()">
	<i class="layui-icon layui-icon-edit"></i> ${button.name!'修改'}
</button>
<script type="text/javascript">
	var slave_${object.code}_update = function() {

        var ID = '${gridId}';
		var PID = '${parentId}';
        
        if (isSelected(ID)) {
        	
        	// ------------------------------级联
            var ref = '';
           	// 主对象关联字段
            var objectField = '${config.objectField!}';
            // 子对象关联字段
            var field = '${field!}';
        	if(parent && objectField != '' && field != ''){
        		// 从父组件上获取选中外键值
        		var val = getSelectVal(PID, objectField);
        		ref = ref + "?ref=" + field + ":" + val;
        	}
        	// ------------------------------级联
        	
        	var val = getSelectVal(ID, 'pk_val');
        	var url = $.str.format('/form/update/${object.code}-{0}{1}', val,ref);
        	var width = ${menu.config.params.width!'720'};
        	var height = ${menu.config.params.height!'undefined'};
            dialog(ID, '${I18N(button.name)} ${object.name}', url , width, height);
        }

	};
</script>